﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using GuestBook_Lib;

namespace Guestbook_2
{
    public partial class Options : Form
    {
        public Options()
        {
            InitializeComponent();
        }
        Settings s = new Settings();
        private void checkBox7_CheckedChanged(object sender, EventArgs e)
        {
            
            s.ShowWebsite(checkBox7.Checked);
            //Preferences.Default.Show_Web_Page = checkBox7.Checked;
            //MessageBox.Show(Preferences.Default.Show_Web_Page.ToString());
            //Preferences.Default.Save();
            //MessageBox.Show(Preferences.Default.Show_Web_Page.ToString());
        }

        private void button5_Click(object sender, EventArgs e)
        {
            s.Reset();
            Options_Load(sender, e);
        }

        private void Options_Load(object sender, EventArgs e)
        {
            checkBox7.Checked = s.ShowWebsite();
            checkBox1.Checked = s.ShowScouting();
            checkBox2.Checked = s.Show_Part();
            checkBox3.Checked = s.Survey();
            panel1.Visible = s.Show_Part();
            panel2.Visible = s.Survey();
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            s.ShowScouting(checkBox1.Checked);
        }

        private void checkBox2_CheckedChanged(object sender, EventArgs e)
        {
            s.Show_Part(checkBox2.Checked);
            checkBox2.Checked = s.Show_Part();
            panel1.Visible = s.Show_Part();
        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {
            s.Survey(checkBox3.Checked);
            checkBox3.Checked = s.Survey();
            panel2.Visible = s.Survey();
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {

        }
        private string File_Select()
        {
            string path = "";
            OpenFileDialog o = new OpenFileDialog();
            o.Filter = "Part File (*.Fpart) |*.Fpart|Survey File (*.Surv)|*.Surv";
            o.ShowDialog();
            return path;
        }
    }
}
